﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; 
using System.Net.Sockets;
using System.Threading;

namespace MKIB3Game
{
    public class testsender
    {
        private string ip = "127.0.0.1";
        private int port = 666;
        TcpClient client ;
        NetworkStream ns;
        
       public  testsender() 
        { 
            client = new TcpClient();
            client.Connect(ip, port);
            NetworkStream ns = client.GetStream();
           
           Console.WriteLine(""+ns.CanWrite);
           String s = "get:time\0";
           System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
           while (true)
           {
               byte[] temp = enc.GetBytes(s);
               ns.Write(temp, 0, temp.Length); 
               Console.WriteLine("schrub " + s);
               Thread.Sleep(1000);
           }
          // Console.ReadLine();
           
           //ns.Close();
        } 
    }
}
